package kr.or.common.util;

import java.util.*;
import java.io.*;

public class PagingUtil {

	private int intTotalSize;
	private int intPageSize;
	private int intPage;
	
	private int intPageViewCount;
	
	
	public void setTotalSize(int intTotalSize) {
		this.intTotalSize = intTotalSize;
	}
	public void setPageSize(int intPageSize) {
		this.intPageSize = intPageSize;
		intPageViewCount = intTotalSize / intPageSize;
	}
	
	public boolean isPage(int intPage) {
		if (intPage > intPageViewCount)
			return false;
		else
			return true;
	}
	
	public void setPage(int intPage) {
		this.intPage = intPage;
	}

	public int getStartRownum() {
		int intTemp = intPage - 1;
		
		if (intTemp == 0) {
			return 0;
		} else {
			return intPageSize * intTemp;
		}
	}
	
	public int getEndRownum() {
		return intPageSize;
	}
	

}

